﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using DAplicaciones1;
namespace persistencia
{
    public class FPersistencia:IPersistencia
    {
        private ConBD conexion;


        public FPersistencia() 
        { 
        }
        public void agregar(Object o){
            Broker b;
            b = Broker.crearBroker(o, conexion);
            b.agregar(o);

        }
        public void modificar(Object o)
        {
            Broker b;
            b = Broker.crearBroker(o, conexion);
            b.modificar(o);
        }
        public void eliminar(Object o)
        {
            Broker b;
            b = Broker.crearBroker(o, conexion);
            b.eliminar(o);
        }
        public void traerDatos(Object o)
        {
            Broker b;
            b = Broker.crearBroker(o, conexion);
            b.traerDatos(o);
        }
        public ArrayList traerLista(Object o)
        {
            Broker b;
            b = Broker.crearBroker(o, conexion);
            return b.traerLista(o);

        }
        public void conectarse(string path)
        {
            conexion = new ConBD();
            conexion.conectarse(path);
        }
        public void desconectarse()
        {
            conexion = new ConBD();
            conexion.desconectarse();
        }
    }
}
